package com.gump.essay.modules.ums.controller;

import com.gump.essay.common.api.CommonResult;
import com.gump.essay.modules.ums.model.UmsMenu;
import com.gump.essay.modules.ums.service.UmsMenuService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 后台菜单管理
 *
 * @auther zzc
 * @date 2020/9/28 16:46
 */
@Controller
@Api(tags = "")
@RequestMapping("menu")
public class UmsMenuController {

    @Autowired
    private UmsMenuService umsMenuService;

    @ResponseBody
    @PostMapping("/create")
    public CommonResult create(@RequestBody UmsMenu umsMenu) {
        boolean success = umsMenuService.create(umsMenu);
        if (success) {
            return CommonResult.success(null);
        } else {
            return CommonResult.failed();
        }
    }
}

